package com.cusc.module_login.mvvm.model;

import android.app.Application;

import com.cusc.lib_api.RetrofitManager;
import com.cusc.lib_api.bean.login.request.Req_login;
import com.cusc.lib_api.bean.login.response.LoginResponse;
import com.cusc.lib_api.http.RxAdapter;
import com.cusc.lib_api.services.LoginServices;
import com.tcgroup.phone.base_core.framework.mvvm.netregister.BaseNetRegister;

import io.reactivex.Observable;

/**
 * 作者: wangfei
 * 创建时期: 2020/3/19.
 * 包名: com.cusc.module_login.netregister
 * 类名: OSAndroidMvvm
 */
public class LoginNetRegister extends BaseNetRegister {

    LoginServices mLoginServices;

    public LoginNetRegister(Application mApplication) {
        super(mApplication);
        mLoginServices = RetrofitManager.getInstance().getLoginService();
    }

    public Observable<LoginResponse> login(Req_login login){
        return mLoginServices.login(login)
                .compose(RxAdapter.schedulersTransformer())
                .compose(RxAdapter.exceptionTransformer());
    }
}
